<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML >
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'login.jsp' starting page</title>
</head>

<body>
	<div>
		<c:if test="${empty userInfo  }">
			<jsp:forward page="login.jsp"></jsp:forward>
		</c:if>
	</div>
	<div>
		<div>
			欢迎：${userInfo.username },<a href="user/exit">退出登录</a>
		</div>
		<div>
			<jsp:include page="left.jsp"></jsp:include>
		</div>

		<div>
			<h2>添加销售记录</h2>

			<form action="sale/addSale" method="post">
				<div>
					<label>商品名称：</label> 
					<select name="productId">
						<option>--请选择商品--</option>
						<c:forEach items="${productList }" var="product">
							<option value="${product.id }">${product.produtname }</option>
						</c:forEach>
					</select>
				</div>

				<div>
					<label>销售价格：</label> <input type="text" name="price" />
				</div>

				<div>
					<label>销售数量：</label> <input type="text" name="quantity" />
				</div>


				<div>
					<input type="submit" value="submit" />
				</div>
			</form>


		</div>
	</div>
</body>
</html>
